// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ScopeVariableEqualityComparer.cs" company="dimamartovoi">
//   Apache License
//   Version 2.0, January 2004
//   http://www.apache.org/licenses
// </copyright>
// <summary>
//   Defines the ScopeVariableEqualityComparer type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections.Generic;

namespace ActorModel.Evolution.SemanticAnalyzing
{
    /// <summary>
    ///     The scope variable equality comparer.
    /// </summary>
    public class ScopeVariableEqualityComparer : IEqualityComparer<LocalVariable>
    {
        #region Public Methods and Operators

        /// <summary>
        /// The equals.
        /// </summary>
        /// <param name="x">
        /// The x.
        /// </param>
        /// <param name="y">
        /// The y.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        public bool Equals(LocalVariable x, LocalVariable y)
        {
            return x.Id == y.Id;
        }

        /// <summary>
        /// The get hash code.
        /// </summary>
        /// <param name="obj">
        /// The obj.
        /// </param>
        /// <returns>
        /// The <see cref="int"/>.
        /// </returns>
        public int GetHashCode(LocalVariable obj)
        {
            return obj.GetHashCode();
        }

        #endregion
    }
}